<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no" />
    <title>录音详情</title>
    <!--标准mui.css-->
    <link rel="stylesheet" href="../css/mui.min.css">
    <script src="../js/mui.min.js"></script>
    <link rel="stylesheet" href="../css/elementui.css">
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="../css/app.css" />
    <link rel="stylesheet" href="../npl/css/vant.mini.css" />
    <script src="../js/vue.js"></script>
    <script src="../js/vconsole.min.js"></script>
    <script src="../js/jquery-3.6.0.min.js"></script>
    <script src="../js/sm2.js"></script>
    <script src="../js/sm3.js"></script>
    <!-- <script src="../js/feedback.js"></script> -->
    <script src="../js/clipboard.js"></script>
    <script src="../js/flexible.js"></script>
    <script src="../npl/js/vant.mini.js"></script>
    <script src="../js/elementui.js"></script>
    <script src="./text.js" type="text/javascript"></script>
    <style>
        .foot {
            /* margin-top: 7.5px; */
            /* margin-bottom: 7.5px; */
            /* margin-left: 5%; */
            /* position: fixed; */
            box-sizing: border-box;
            width: 100%;
            /* height: 1.7rem; */
            text-align: center;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
        }

        .left a {
            line-height: 0.5rem;
            color: #1E3754;
        }

        .left .left1 {
            position: absolute;
            left: 0.1rem;
            top: 0.25rem;
        }

        .left :nth-child(1) span {
            line-height: 0.5rem;
            color: #fff;
        }

        .top {
            height: 4.5rem;
            width: 100%;
            box-sizing: border-box;
            font-size: 0.3rem;
            /* border: 3px dashed rgb(25, 179, 182); */
            position: relative;
            border-radius: 10px;
            padding: 0.3rem;
            margin-bottom: 0.3rem;
            background-color: #fff;
        }

        .shorthand {
            padding: 0;
            flex: 1;
        }

        .hr {
            background-color: rgba(95, 132, 247, 1);
            width: 1.5px;
            height: 0.04rem;
            float: right;
            margin-left: 6px;
            animation: liner 1s ease-in-out;
            animation-iteration-count: infinite;
            animation-direction: alternate;
        }

        .hr1,
        .hr4,
        .hr7,
        .hr10,
        .hr13,
        .hr16,
        .hr19,
        .hr22,
        .hr25 {
            animation-delay: -2s;
        }

        .hr2,
        .hr5,
        .hr8,
        .hr11,
        .hr14,
        .hr17,
        .hr20,
        .hr23,
        .hr26 {
            animation-delay: -1s;
        }

        .hr3,
        .hr6,
        .hr9,
        .hr12,
        .hr15,
        .hr18,
        .hr21,
        .hr24 {
            animation-delay: -1.5s;
        }

        @keyframes liner {
            0% {
                transform: scaleY(1);
            }

            100% {
                transform: scaleY(6);
            }
        }

        .start {
            width: 100%;
            height: 100%;
        }

        /* WebKit browsers */

        ::-webkit-input-placeholder {
            color: #D8E6FE;
        }

        /* Mozilla Firefox 4 to 18 */

        :-moz-placeholder {
            color: #D8E6FE;
            opacity: 1;
        }

        ::-moz-placeholder {
            color: #D8E6FE;
            opacity: 1;
        }

        :-ms-input-placeholder {
            color: #D8E6FE;
        }

        .mui-toast-container {
            top: 50%
        }

        .clipboardContent {
            position: relative;
            display: flex;
            overflow-y: auto;
           height: 100%;
            -webkit-touch-callout:text
            /* background-color: rgb(255, 255, 255); */
            /* height: 100%; */
        }

        .output_box {
            background-color: rgb(255, 255, 255);
            height: 100%;
            /* border: 1px solid #D8E6FE; */
            border: none;
            color: #333;
            padding: 10px 6px;
        }

        .clipboardContent img {
            width: 0.3rem;
        }

        .form_box {
            padding: 0 0 .1rem 10px;
            height: calc(100% - 2.1rem);
            /* background: #fff; */
            flex: 1;
            z-index: 0;
            position: relative;
            overflow: hidden;
            border-radius: 0 0 15px 15px;
            /* margin: 0.2rem 0.2rem 0.2rem; */
        }
        .form {
           
           width: 100%;
           height: 100%;
        }

        .voice-list,
        .voice-list li {
            display: none;
        }

        .is-dialog {
            overflow: hidden;
        }

        .is-dialog .dialog {
            filter: progid: DXImageTransform.Microsoft.Alpha(enabled=false);
            /* opacity: 0.7; */
            /* z-index: 1111; */
        }

        .is-dialog .dialog {
            filter: progid: DXImageTransform.Microsoft.Alpha(enabled=false);
        }

        .Btn {
            display: flex;
            justify-content: space-between;
            /* padding: 0.2rem 0.3rem; */
            /* background: #fff; */
            align-items: center;
            flex-wrap: wrap;
        }

        .uldis {
            display: flex;
            flex-direction: column;
            justify-content: center;
            flex-wrap: wrap;
            margin: 0;
            padding: 0;
            align-items: center;
        }

        .btn_r {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .Btn_l {
            display: flex;
        }

        .last_Btn {
            width: .7rem;
            height: .7rem;
            margin-left: .4rem;
        }

        .img_box {
            width: .7rem;
            height: .7rem;
        }

        .title_img {
            margin: 0 10px;
            width: .4rem;
            height: .4rem;
        }

        .title_img img {
            width: 100%;
            height: 100%;
        }

        .titleName {
            color: #1E3754;
            width: 90%;
            font-weight: bold;
            font-size: 18px;
        }

        .btn_l_img {
            width: .6rem;
            height: .6rem;
        }

        .btn_l_img img {
            width: 100%;
            height: 100%;
        }

        .aaa {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .content_wrapper {
            width: 100%;
            display: flex;
            flex-direction: column;
            flex: 1;
            background: url(../image/text_bgd.png);
            background-size: 100% 100%;
            background-repeat: no-repeat;
            height: calc(100vh - 2.7rem);
        }

        .content_wrapper .header_title {
            padding: .5rem .5rem 0;
        }

        .title_inp {
            width: 50%;
        }

        .title_inp input {
            border: none !important;
        }

        .van-popup--center {
            border-radius: 12px;
            width: 80%;
            padding: 20px 10px 10px;
            display: flex;
            justify-content: space-around;
            flex-direction: column;
            height: 25%;
        }

        .van-cell {
            align-items: center;
            padding: 10px 2px 10px 5px;
            justify-content: space-between;
        }

        .van-cell input[type=text] {
            margin: 0;
            padding: 5px 10px
        }

        .van-field__label {
            margin: 0px;
            width: 1rem;
            font-size: 15px;
        }

        .form_btn {
            display: flex;
            justify-content: space-around;
        }

        .form_btn .qx {
            background-color: rgba(45, 52, 60, 0.08);
            border-radius: 48px;
            font-family: PingFang SC;
            color: rgba(45, 52, 60, 0.8);
        }

        .form_btn .tj {
            background-color: #5f84f7;
            color: #fff;
            border-radius: 48px;
        }

        .van-button--normal {
            padding: 4px 28px;
            font-size: 14px;
        }


        .xuxian {
            border: 1px rgba(45, 52, 60, 0.04) dashed;
            background-color: none;
        }

        .curtainVoice {
            display: none;
            position: fixed;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background-color: rgba(0, 0, 0, 0.3);
            /* -moz-transition: all 1s ease;
	-o-transition: all 1s ease;
	-webkit-transition: all 1s ease;
	transition: all 1s ease; */
            /* filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); */
            z-index: 9999;
            overflow: hidden;
        }

        .title_header {
            color: rgba(95, 132, 247, 1);
            font-size: 16px;
            -webkit-user-select: text !important;
            user-select: text !important;
            margin-bottom: -15px;
            font-weight: 600;
        }

        .text_box {
            white-space: pre-wrap;
            word-break: break-word;
            background-color: none;
            font-size: 18px;
            user-select:text !important;
            line-height: 25px;
            font-weight: 400;
            color: rgba(45, 52, 60, 1);
        }

        .centent_wrapper {
            width: 90vw;
            /* flex: 1; */
            height: 100%;
            overflow-y: auto;
            -webkit-user-select: text !important;
            padding-left: .3rem;
        }

        #targetDiv {
            /* flex:1; */
            display: flex;
            flex-direction: column;
            height: 100%;
            overflow:hidden;
        }

        .highlight {
            color: red;
        }

        .sliderClass {
            padding-left: 5px;
            height: 25px;
        }

        .audioControl {
            background-color: #f9fbfa;
            width: 100%;
            height: 1.7rem;
            display: flex;
            align-items: center;
            border-radius: .3rem .3rem 0 0;
        }

        .errorMask {
            text-align: center;
            width: 100%;
            background-color: #e3dfdf;
            opacity: .1;
            height: 100%;
            position: absolute;
            top: 0%;
            left: 0;
            z-index: 109;
        }

        .errorText {
            color: grey;
            font-weight: bold;
            font-size: 18px;
            text-align: center;
            width: 100%;
            position: absolute;
            top: 48%;
            left: 0;
            z-index: 200;
        }

        .audioClose {
            position: absolute;
            top: 46%;
            right: 19%;
            font-size: 25px;
            z-index: 999;
        }

        .musicPlay {
            display: flex;
            width: 100%;
            /* height: 70px; */
        }

        .playControl {
            display: flex;
            align-items: center;
            user-select: none;
            width: 100%;
            /* margin-top: 12px; */
            justify-content: space-between;
            /* padding-top: 5px; */
            padding-left: 5px;
            /* width: 320px;
            height: 40px; */
        }

        .audioVolSpan {
            margin-right: 10px;
            margin-left: 32%;
        }

        .audioSpan,
        .audioVolSpan {
            color: #333;
            font-size: 24px;
            /* margin-right: 30px; */
            cursor: pointer;
        }

        .speed {
            font-size: 16px;
        }

        .sliderVolumClass {
            display: inline-block;
            width: 25%;
        }

        .mySelect .el-input__suffix {
            display: none;
            /* 隐藏下拉框箭头 */
        }

        .mySelect .el-select__input,
        .mySelect .el-select__input.is-focus,
        .mySelect .el-input__inner {
            border: none;
            /* 取消边框 */
        }

        .el-input--suffix .el-input__inner {
            padding-right: 0px !important;
        }

        .mySelect .input[type=color],
        input[type=text],
        select,
        textarea {
            background-color: #fff;
            /* 设置背景颜色 */
        }

        .mySelect .el-select-dropdown {
            font-size: 16px;
            font-weight: bold;
            /* 设置下拉框中文字的大小 */
        }

        .mySelect .el-input__inner {
            font-size: 16px;
            font-weight: bold;
            /* 设置下拉框中文字的大小 */
            padding-bottom: 15px;
        }

        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            /* background-color: rgba(255, 255, 255, 0.7);  */
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            /* 确保 loading 容器在其他内容上方显示 */
        }

        [v-cloak] {
            display: none;

        }

        /* .el-scrollbar {
            > .el-scrollbar__bar {
                opacity: 1 !important;
            }
        } */

        .van-dropdown-item__content {
            width: 1.2rem;
            /* 设置你想要的宽度 */
        }

        .van-ellipsis {
            font-size: 16px;
            font-weight: bold;
        }

        .van-dropdown-menu__bar {
            box-shadow: none;
            background-color: #f9fbfa;
        }

        .van-dropdown-item__content .van-cell {
            background: #f9fbfa;
        }

        .van-dropdown-menu__title::after {
            border: none;
        }

        .van-overlay {
            /* background: none !important; */
            top: -.2rem;
            left: 0;
        }

        .van-popup--bottom {
            bottom: 0.2rem;
            left: 0.2rem;
            /* border:1px solid #ccc; */
        }

        .abstract {
            position: absolute;
            top: 1.7rem;
            right: -1.3rem;
            text-align: center;
            font-size: 12px;
            width: 2rem;
            height: .8rem;
            /* z-index: 9999; */
            border-radius: 10px;
            color: #fff;
            line-height: 1.4;
            display: flex;
            justify-content: center;
            align-items: center;
            transition: all .5s;
        }

        .abstractUnfold {
            right: 0;
            transition: all .5s;
        }

        .abstract .znzy {
            width: 100%;
            height: 100%;
            background: url(../image/hyjy.png) no-repeat;
            background-size: 100% 100%;
            display: flex;
            align-items: center;
            padding-left: 6px;
        }

        .abstract .znzy img {
            width: .5rem;
            height: .5rem;
        }

        .content-abstract {
            height: 40vh;
            overflow: auto;
            border: none;
            margin: 0;
        }

        .dialog-title {
            padding: 0.3rem;
            border-bottom: 1px solid #eee;
            text-align: center;
        }

        .dialog-content {
            padding: 0.3rem;
            line-height: 1.5;
        }

        .dialog-foot {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.3rem;
        }

        .dialog-foot-icon {
            width: 0.4rem;
            height: .4rem;
            margin-right: 0.4rem;
        }

        .dialog-foot-icon:nth-child(3),
        .dialog-foot-icon:nth-child(4) {
            width: .96rem;
            height: .56rem;
            margin-right: 0;
        }

        .dialog-foot-icon:nth-child(3) {
            margin-right: 0.2rem;
        }

        .van-dialog {
            /* border: 1px solid #ccc; */
            /* box-shadow: #eae8e8de 0px 0px 3px 3px; */
        }

        .editBtn {
            width: 45%;
            height: 36px;
        }

        .edit_title_input input {
            background-color: #F0F3F8;
        }

        .form_btn {
            display: flex;
            justify-content: center;
        }

        .form_btn .van-button {
            flex: 1;
        }

        .form_btn .van-button:nth-child(1) {
            /* margin-right: 20px; */
        }
    </style>
</head>

<body>
    <div id="app" v-cloak v-if="bodyShow">
        <div class="is-loading">
            <div class="is-loading">
                <div class="curtain" id="curtain">
                    <div class="loadingBgc">
                        <div class="loader"></div>
                    </div>
                </div>
            </div>
        </div>

        <div class="aaa">
            <div class="trainTicketstitle">
                <div class="header_tit">
                    <van-nav-bar v-cloak title="" left-arrow>
                        <template #left>
                            <div class="back_l" @click="home"><img src="../image/left.png" alt=""></div>
                        </template>
                        <template #right>
                            <template v-if="!isEditable">
                                <div v-show="showToggle" class="back_r" @click="toShorthand()" style="width: .38rem;height: .38rem;"><img src="../image/lu_qiehuan.png" alt="" style="width: 100%;height: 100%;"></div>
                                <div class="back_r" @click="isEditable = true" style="width: .38rem;height: .38rem;">
                                    <img src="../image/lu_edit.png" alt="" style="width: 100%;height: 100%;"></div>
                                <!-- <div class="back_r" style="width: .52rem;height: .52rem;"><img src="../image/abstract.png" alt="" style="width: 100%;height: 100%;"></div> -->

                                <!-- <div class="back_r" style="width: .52rem;height: .52rem;"><img src="../image/edit.png" alt="" style="width: 100%;height: 100%;"></div> -->
                                <div class="back_r tag-read" @click="site(0)" style="width: .38rem;height: .38rem;"><img
                                        src="../image/copy.png" alt="" style="width: 100%;height: 100%;"></div>
                                <div class="back_r" @click="site(1,0)" style="width: .96rem;height: .56rem;"><img
                                        src="../image/shuoyishuo_youx.png" alt="" style="width: 100%;height: 100%;"></div>
                                <div class="back_r" @click="site(1,3)" style="margin-left:-5px;width: .96rem;height: .56rem;"><img
                                        src="../image/tb.png" alt="" style="width: 100%;height: 100%;"></div>
                            </template>


                            <div v-show="isEditable" class="Btn_1">
                                <van-button round type="default" class="editBtn" @click="isEditable = false">取消
                                </van-button>
                                <van-button style="margin-left: 10px;" round type="primary" class="editBtn"
                                    color="#13C09B" @click="editSave()">保存</van-button>
                            </div>
                        </template>
                    </van-nav-bar>
                </div>
            </div>
            <div class="content_wrapper">
                <van-skeleton title :row="3" :loading="initLoading">
                    <div class="header_title">
                        <van-popup style="min-height: 4rem;" :close-on-click-overlay="false" v-model="showPop">
                            <van-form>
                                <div style="text-align: center;font-size: 18px;font-weight:bold;">标题重命名</div>
                                <van-field v-model="inputText" class="edit_title_input" placeholder="请输入标题"
                                    maxlength="100" />
                            </van-form>
                            <div class="form_btn">
                                <van-button type="default" round @click="del">取消</van-button>
                                <van-button type="primary" color="#13C09B" round @click="confirm">确定</van-button>
                            </div>
                        </van-popup>

                        <div v-cloak>
                            <div style="display: inline-block;">
                                <span
                                    style="font-size: 14px;color: gray;display: flex;align-items: center;">{{timeText}}</span>
                            </div>
                            <p @click="header_title"
                                style="color: black;font-size: 24px;font-weight: bold; margin: 10px 0;line-height: 24px;">
                                {{filteredFileName}}</p>
                        </div>
                    </div>
                </van-skeleton>
                <van-divider></van-divider>
               <div class="form_box">
                <div v-cloak ref="form" class='form'>
                    <div class="loading-overlay" v-show="isLoading">
                        <div style="width: 0.84rem;height: 0.84rem;">
                            <img src="../image/loading2.gif" alt="" style="height: 100%;width: 100%;" />
                        </div>
                    </div>
                    <div id="clipboardContent" class='clipboardContent'>
                        <div id="targetDiv">
                            <div style=" display: flex; align-items: center;padding-left: 98%;padding-right: 0px;height: 0px;width: 0px;"
                                @mousedown="isDraging = true" @mouseup="isDraging = false">
                                <van-slider v-model="playProcess" button-size="12px" active-color="rgb(185, 235, 245)"
                                    vertical
                                    style="height: 53vh !important;width: 1%;position: fixed;top: 4.2rem;margin-left: 5px;z-index: 99;"
                                    @change="setProcessFunc" />
                            </div>
                            <div :contenteditable="isEditable" class="centent_wrapper" ref="cententWrapper" id="centent_wrapper">
                                <div style="user-select:text !important;" v-cloak v-for="(item,index) in audio_speaker_content">
                                    <strong class="title_header" :id="index" @click="openDialog(item,index)"
                                        :style="getSpeakerNameColor(item.speakerName)">{{item.speakerName}}</strong>
                                    <strong class="title_header"
                                        :style="getSpeakerNameColor(item.speakerName)">:</strong>
                                    <br>
                                    <span style="user-select:text !important;-webkit-user-select: text" class="text_box" :id="content.serialNum" v-for="content in item.content"
                                        @click="readText(content)" >{{content.word}}</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
               </div>
            </div>
            <div class='foot'>
                <div class="Btn">

                    <div class="musicPlay">
                        <audio ref="audio" id="course-aud" @play="playFunc" @pause="pauseFunc"
                            @timeupdate="timeupdateFunc" @waiting="waitingFunc" preload="auto" @canplay="canplayFunc"
                            @error="errorFunc" :src="audioSrc">
                        </audio>
                        <div class="audioControl">
                            <div class="playControl">
                                <van-dropdown-menu active-color="#1989fa" direction="up">
                                    <van-dropdown-item v-model="playSpeed" :options="speedList"
                                        @change="clickFunc('speed')" />
                                </van-dropdown-menu>

                                <div class="audioSpan" @click="skipTime(-5)" style="width: 0.5rem;height: 0.54rem;">
                                    <img style="width: 100%; height: 100%;" src="../image/speed2.png" alt="">
                                </div>
                                <span class="audioSpan" @click="clickFunc('play')" v-show="!isPlaying"
                                    style="margin: 0 .3rem;width: 1rem;height: 1rem;">
                                    <img style="width: 100%; height: 100%; " class="active-brightness"
                                        src="../image/luyin_bf.png" alt="">
                                </span>
                                <span class="audioSpan" @click="clickFunc('pause')" v-show="isPlaying" style="
                                margin: 0 .3rem;width: 1rem;height: 1rem;">
                                    <img style="width: 100%; height: 100%;" class="active-brightness"
                                        src="../image/luyilu_STOP.png" alt="">
                                </span>

                                <span class="audioSpan" @click="skipTime(5)"
                                    style="margin-right: .3rem;width: 0.5rem;height: 0.54rem;">
                                    <img style="width: 100%; height: 100%;" src="../image/speed1.png" alt="">
                                </span>

                                <div style="display: flex; align-items: center;height: 60px;width: 60px;">
                                    <div style="color: #333; text-align: center;font-size: 12px;">
                                        {{ formatCurrentTime }}
                                        <div
                                            style="height: 1px;width:35px;background: rgba(255,255,255,1);border: none;border-top: 1px solid #555555;">
                                        </div>
                                        {{ formatDuration }}
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <van-popup :close-on-click-overlay="false" v-model="dialogVisible">
            <van-form>
                <van-field v-model="updateSpeakerName" label="名称：" placeholder="请输入发言人" maxlength="100" />
            </van-form>
            <div class="form_btn">
                <div>
                    <van-button class="qx" @click="qxfyr">取消</van-button>
                    <van-button class="tj" color="#19aeb0" @click="updateSpeaker">确认</van-button>
                </div>
            </div>
        </van-popup>
        <div class="abstract" :class="abstractUnfold?'abstractUnfold':''">
            <div @click="scjy" class="znzy">
                <img v-show="!abstractLoading" src="../image/luyilu_gb.png" alt="">
                <van-loading v-show="abstractLoading" type="spinner" size="24px" color="#fff" />
            </div>
        </div>
        <!-- <van-dialog width="360px" v-model="showDialog" :show-confirm-button="false">
            <div class="dialog-title" >
              智能摘要
              <van-icon name="cross" style="float: right;" @click="showDialog = false,abstractUnfold=false"/>
            </div>
            <div class="dialog-content">
              <textarea ref="editAbstract" type="text" maxlength="1000" :readonly="readonly" class="content-abstract" v-model='abstractContent'></textarea>
            </div>
            <div v-show="readonly" class="dialog-foot">
                <van-badge :dot="showDot">
                    <div @click="getAbstract" style="display: flex;color: #13C09B;">
                        <van-icon style="margin-right: 4px;" name="replay" />
                        <span>重新生成</span>
                    </div>
                </van-badge>
                <div style="display: flex;align-items: center;">
                    <img src="../image/lu_edit.png" @click="toggleEdit('edit')" class='dialog-foot-icon active-brightness'>
                    <img src="../image/copy.png" @click="copy(1, 'copy-abstract')" class='dialog-foot-icon copy-abstract active-brightness'>
                    <img src="../image/join1.png" @click="checkJion" class='dialog-foot-icon active-brightness'>
                    <img src="../image/lu_youx.png" @click="absMailbox" class='dialog-foot-icon active-brightness'>
                </div>
            </div>
            <div v-show="!readonly" class="dialog-foot">
                <div style="display: flex; justify-content: space-around; width: 100%;">
                    <van-button round block class="editBtn" @click="toggleEdit('read')" type="default">取消</van-button>
                    <van-button round block class="editBtn" :loading="saveLoading" @click="saveAbstract" color="#13C09B" type="primary">保存</van-button>
                </div>
            </div>
        </van-dialog> -->
        <img v-if="handleProcessClick.showBackTopIcon" src="../image/back-top.png" @click="recoverProcess()"
            style="position: fixed;right: 19px;bottom: 69px;width: 35px;" alt="">
    </div>
    <script>
        function toStringFunc(param) {
            if (param > 9) {
                return param + ''
            } else {
                return '0' + param
            }
        }
        new Vue({
            el: '#app',

            data() {
                let jsApiList = [];
                let voicelist = [];
                let uploadlist = [];
                // $(function(){
                $.getScript("../js/jweixin-sgccigw-1.0.0.js" /*"js/jweixin-1.0.0.js"*/, function () {
                    'use strict';
                    wx.ready(function () { });
                    jsApiList = [
                        'startRecordVoiceBuffer',
                        'onRecordBufferReceived',
                        'stopRecord',
                    ];
                    wx.config({
                        beta: true, // 调用wx.invoke形式的接口值时，该值必须为true。
                        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                        appId: appid, // 必填，政务微信的cropID
                        timestamp: '1626832073', // 必填，生成签名的时间戳
                        nonceStr: nonceStr, // 必填，生成签名的随机串
                        signature: 'fb9f560a9b4824f7db3525926994010de74ea055', // 必填，签名，见附录1
                        jsApiList:   jsApiList // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
                    });
                });
                // })
                return {

                    handleProcessClick: {
                        isHandleProcess: false,
                        formDom: null,
                        scrollTop: 0,
                        showBackTopIcon: false
                    },
                    initLoading: true,//骨架屏
                    showToggle: false,
                    saveLoading: false,
                    readonly: true,
                    showDot: false,
                    showDialog: false,
                    abstractContent: '',
                    abstractContentBak: '',
                    abstractLoading: false,
                    abstractUnfold: false,
                    bodyShow: false,
                    oldName: '',
                    isflageIOX: true,
                    titleText: '',
                    timeText: '',
                    inputText: '',
                    flag: true,
                    content: '',
                    TIME: new Date(),
                    audio_speaker_content: [],

                    readData: [],
                    VoiceFlag: false,
                    VoiceItem: {},
                    voiceTxt: {
                        old: '',
                        ind: null
                    },
                    inputDom: null,
                    oldText: '',
                    oldTextitle: '',
                    showPop: false,
                    changearr: [],
                    audio: null,
                    audioSrc: '',
                    // audioSrc: 'https://baikevideo.cdn.bcebos.com/media/mda-OdfGZXY16SVdPBHF/eecf7fe9ac1aee3880ba0fae57d1f2f7.mp4',
                    cursorTimer: null,
                    isPlaying: false,
                    isError: false,
                    isDataError: false,
                    errorMsg: '暂无数据',
                    audioVisible: true,
                    isDraging: false,
                    playProcess: 0,
                    playVolume: 50,
                    playSpeed: 1,
                    totalTimes: '00:00',
                    currentTime: '00:00',
                    speedList: [{
                        value: 3,
                        text: '3x',
                    }, {
                        value: 2,
                        text: '2x',
                    }, {
                        value: 1.5,
                        text: '1.5x',
                    }, {
                        value: 1,
                        text: '1.0x',
                    }, {
                        value: 0.75,
                        text: '0.75x',
                    }, {
                        value: 0.5,
                        text: '0.5x',
                    }],
                    updateSpeakerName: '',
                    updateSpeakerItem: '',
                    dialogVisible: false,
                    radioType: '0', //判断修改当前发言人名称或是全部相同发言人名称  
                    isEditable: false,
                    nameColor: {},
                    isLoading: false,
                    lastScrollTopTime: Date.now(),
                    lastScrollTop: 0,
                    colorList: ["#FF88C2", "#FF8888", "#FFA488", "#FFBB66", "#FFDD55", "#FFFF77", "#DDFF77", "#BBFF66", "#66FF66", "#77FFCC", "#77FFEE", "#66FFFF", "	#77DDFF", "#99BBFF", "#9999FF", "#9F88FF", "#B088FF", "#D28EFF", "#E38EFF", "#FF77FF"],
                    audioExtensions: [
                        '.mp3', '.wav', '.pcm', '.amr', '.m4a',
                        '.MP3', '.WAV', '.PCM', '.AMR', '.M4A'
                    ]
                }
            },
            created() {
                let now = new Date();
                let hours = now.getHours();
                let minutes = now.getMinutes();
                if (minutes < 10) {
                    minutes = '0' + minutes;
                }
                this.timeText = hours + ':' + minutes;
                this.compatibleInput()
                let FullYear = now.getFullYear();
                let month = now.getMonth() + 1;
                month = month < 10 ? '0' + month : month;
                let day = now.getDate();
                day = day < 10 ? '0' + day : day;
                var url = location.search
                var str = window.sessionStorage.getItem("OnSiteShorthandItem")
                if (str) {
                    this.VoiceItem = window.sessionStorage.getItem("OnSiteShorthandItem")
                    this.VoiceItem = JSON.parse(this.VoiceItem)
                    var VoiceItemID = this.VoiceItem.id
                    this.totalTimes = Number(this.VoiceItem.voiceDuration);
                    this.subStance(VoiceItemID)
                    this.showToggle = this.VoiceItem.access == 2
                } else {
                    this.titleText = FullYear + '.' + month + '.' + day + '工作会议';
                    this.timeText = FullYear + '年' + month + '月' + day + '日 ' + this.timeText;
                    this.content = '';
                    this.initLoading = false

                }
                // if(this.audio_speaker_content.length == 0) {
                //     this.isDataError = true;
                // }
                this.$nextTick(() => {
                    this.inputDom = document.getElementById("output_box")
                })
            },

            mounted() {
                setTimeout(() => {
                    this.bodyShow = true
                    this.$nextTick(() => {
                        // 监听form滚动条
                        // this.handleProcessClick.formDom = document.getElementsByClassName("form")[0];
                        // this.handleProcessClick.formDom.addEventListener('scroll', () => {
                        //   const currentScrollTop = this.handleProcessClick.formDom.scrollTop;
                        //   const scrollDelta = currentScrollTop - this.lastScrollTop;
                        //   const scrollVelocity = scrollDelta / (Date.now() - this.lastScrollTopTime);
                        //   // 输出滚动速度
                        //   // console.log('Scroll Velocity:', scrollVelocity);
                        //   // scrollVelocity > 1 向下滑动 、 scrollVelocity < 0 向上滑动
                        //   if(scrollVelocity > 1 || scrollVelocity < 0){
                        //     this.handleProcessClick.isHandleProcess = true
                        //   }
                        //   // 更新上一次滚动位置和时间
                        //   this.lastScrollTop = currentScrollTop;
                        //   this.lastScrollTopTime = Date.now();

                        // });

                        let startTime = null;
                        let startScrollTop = 0;
                        const element = document.getElementsByClassName("form")[0];
                        element.addEventListener('scroll', () => {
                            if (startTime === null) {
                                startTime = new Date().getTime(); // 记录开始时间
                                startScrollTop = element.scrollTop; // 记录开始滚动位置
                            } else {
                                const currentTime = new Date().getTime();
                                const timeDiff = currentTime - startTime; // 时间差
                                const endScrollTop = element.scrollTop; // 当前滚动位置
                                const distanceScrolled = endScrollTop - startScrollTop; // 计算滚动距离
                                // console.log('distanceScrolled',distanceScrolled)
                                // 显示隐藏backTop图标
                                console.log('endScrollTop', endScrollTop)
                                this.handleProcessClick.showBackTopIcon = Math.abs(this.handleProcessClick.scrollTop - endScrollTop) > 300 && this.handleProcessClick.isHandleProcess == true ? true : false

                                setTimeout(() => {
                                    startTime = null; // 重置开始时间和滚动位置
                                    // console.log(`滚动了 ${distanceScrolled} 像素`);
                                    // 如果滚动的像素在此范围 就代表是用户在滑动滚动条
                                    if (Math.abs(distanceScrolled) > 100) {
                                        this.handleProcessClick.isHandleProcess = true
                                    }
                                }, 500)

                            }
                        });
                    })

                }, 400)
            },
            //         mounted() {
            //     var musicDom = $('#course-aud')[0];
            //     let that = this
            //     musicDom.load();
            //     musicDom.onloadedmetadata = function () {
            //       that.currentTime = musicDom.duration;
            //       console.log('加载的匿名函数',that.duration);
            //     };
            //   },
            filters: {
                textNum: (value) => {
                    if (!value) return "";
                    let data = value.split("");
                    if (data.length < 12) {
                        return value;
                    }
                    return value.slice(0, 12) + "...";
                },
                fmtPlaySpeed(pSpeed) {
                    return pSpeed.toFixed(1)
                }
            },
            computed: {
 // 计算属性：实时过滤文件名后缀
 filteredFileName() {
                    let fileName = this.titleText.trim();

                    // 逐个检查并移除匹配的后缀
                    for (const ext of this.audioExtensions) {
                        if (fileName.endsWith(ext)) {
                            return fileName.slice(0, -ext.length);
                        }
                    }
            
                    return fileName;
                },
                formatDuration() {
                    if (typeof this.totalTimes === 'number') {
                        const fTotal = Math.floor(this.totalTimes)
                        const tempMin = Math.floor(fTotal / 60)
                        const tempSec = fTotal % 60
                        return `${toStringFunc(tempMin)} : ${toStringFunc(tempSec)}`
                    }
                    return '00 : 00'
                },
                formatCurrentTime() {
                    if (typeof this.currentTime === 'number') {
                        const fTotal = Math.floor(this.currentTime)
                        const tempMin = Math.floor(fTotal / 60)
                        const tempSec = fTotal % 60
                        return `${toStringFunc(tempMin)} : ${toStringFunc(tempSec)}`
                    }
                    return '00 : 00'
                }
            },
            methods: {
                scjy() {
                    this.abstractLoading = true
                    this.abstractUnfold = true
                    userId = sessionStorage.getItem("userId");
                    orgId = sessionStorage.getItem("unitId")
                    const timestamp = new Date().getTime() + ""
                    const AuthenticationSession = sessionStorage.getItem("Authentication");
                    iscp_port = sessionStorage.getItem("iscp_port") || "";
                    let data = {
                        sceneNo: 37,
                        text: this.audio_speaker_content,
                        title: this.titleText,
                        userId: userId,
                        toFile: 1,
                        orgId: orgId,
                        timestamp: timestamp
                    }
                    data = JSON.stringify(data)
                    let sign = sm3(data);
                    $.ajax({
                        // url: url,
                        url: localUrlLink + iscp_port + "/tjAiAssistant/shareFile/shareToBase64",
                        type: "post",
                        async: false, //是否同步，false表示同步请求
                        dataType: "json",
                        data: data,
                        headers: {
                            "Content-Type": "application/json;charset=UTF-8",
                            Authentication: AuthenticationSession,
                            sign: sign,
                            userId: userId,
                            timestamp: timestamp
                        },
                        success: (res, txt, xhr) => {
                            if (sm3(res.resultValueStr) == xhr.getResponseHeader("sign")) {
                                if (res.code == 200) {
                                    console.log(res,"所有参数")
                                    sessionStorage.setItem("minutes_subjectTitle", sessionStorage.getItem("fileNameYU"))
                                    let data = {
                                        "id": res.resultValue.id,
                                        "fileName": sessionStorage.getItem("fileNameYU"),
                                        "type": "WORD",
                                        "img": "word",
                                        "fileSize": res.resultValue.size
                                    }
                                    sessionStorage.setItem("minutes_fileInfo", JSON.stringify(data))
                                    setTimeout(() => {
                                        $(location).attr("href", "./yr/write/meetingMinutes.html");
                                    }, 1200)
                                } else {
                                    $("#curtain").css("display", "none");
                                    mui.toast(res.resultValue, {
                                        duration: 'long',
                                        type: 'div'
                                    })
                                }
                            } else {
                                $("#curtain").css("display", "none");
                                mui.toast('完整性校验失败', {
                                    duration: 'long',
                                    type: 'div'
                                })
                            }
                        },
                        error: (e) => {
                            $("#curtain").css("display", "none");
                            mui.toast('请求异常,请稍后再试', {
                                duration: 'long',
                                type: 'div'
                            })
                        },
                    })
                },
                checkJion() {
                    $("#curtain").css("display", "block");
                    data = {
                        sceneNo: 37,
                        text: this.audio_speaker_content,
                        title: this.titleText
                    }
                    var dataType = greneralRequest("/tjAiAssistant/shareFile/shareToBase64", JSON.stringify(data), 1)
                },
                toggleEdit(type) {
                    if (type === 'edit') {
                        this.readonly = false
                        this.abstractContentBak = this.abstractContent
                    } else {
                        this.readonly = true
                        this.abstractContent = this.abstractContentBak
                    }
                },
                toShorthand() {
                    $(location).attr("href", "OnShorthandDetails.html");
                },
                getSpeakerNameColor(item) {
                    return "color: " + this.nameColor[item] + ";";
                },
                openEdit() {
                    this.isEditable = !this.isEditable;
                },

                editSave() {
                    this.audio_speaker_content.forEach(
                        speaker => {
                            speaker.content.forEach(content => {
                                content.word = document.getElementById(content.serialNum).innerHTML;
                            })
                        }
                    );
                    this.isEditable = false
                    this.complete();
                },
                readText(item) {
                    this.$refs.audio.currentTime = Number(item.startTime) / 1000
                    setTimeout(() => {
                        this.handleProcessClick.isHandleProcess = false
                    }, 1000)
                    console.log(item)
                },
                qxfyr() {
                    this.dialogVisible = false
                    this.updateSpeakerName = ""
                },
                handleClose() {
                    this.dialogVisible = false;
                },
                openDialog(item, index) {
                    this.dialogVisible = true;
                    this.updateSpeakerName = item.speakerName;
                    this.updateSpeakerItem = item;
                },
                queryAbstract(flag) {
                    this.abstractLoading = true
                    this.abstractUnfold = true
                    this.checkJion()
                    return
                    let data = {
                        id: this.VoiceItem.id,
                        timestamp: new Date().getTime() + ""
                    }
                    let AuthenticationSession = sessionStorage.getItem("Authentication");
                    data = JSON.stringify(data)
                    let sign = sm3(data);
                    $.ajax({
                        url: localUrlLink + iscp_port + '/tjAiAssistant/digest/selectDigestById',
                        type: "post",
                        async: false, //是否同步，false表示同步请求
                        dataType: "json",
                        data,
                        headers: {
                            "Content-Type": "application/json;charset=UTF-8",
                            Authentication: AuthenticationSession,
                            sign: sign
                        },
                        success: (res, txt, xhr) => {
                            if (res.code == 200) {
                                // console.log(res)
                                if (res.resultValue.digestStateTitle == -1) {
                                    this.getAbstract()
                                } else if (res.resultValue.digestStateTitle == 0) {
                                    if (!this.abstractLoading) {
                                        this.abstractLoading = true
                                        this.abstractUnfold = true
                                    }
                                    setTimeout(() => {
                                        this.queryAbstract()
                                    }, 1000)
                                } else if (res.resultValue.digestStateTitle == 1) {
                                    this.showDialog = true
                                    this.abstractContent = res.resultValue.digestMessageTitle
                                    this.abstractLoading = false
                                    this.abstractUnfold = true
                                    this.showDot = res.resultValue.offlineEditDigest == 0
                                } else if (res.resultValue.digestStateTitle == 3) {
                                    console.log(888, flag)
                                    if (flag) {
                                        this.getAbstract()
                                    } else {
                                        mui.toast('摘要生成失败，请重试', {
                                            duration: '1000',
                                            type: 'div'
                                        })
                                    }
                                    this.abstractLoading = false
                                    this.abstractUnfold = false
                                }
                            } else {
                                mui.toast(res.resultValue, {
                                    duration: '1000',
                                    type: 'div'
                                })
                            }
                        },
                        error: (e) => {
                            mui.toast('请求异常,请稍后再试', {
                                duration: '1000',
                                type: 'div'
                            })
                        },
                    })
                },
                // 生成摘要
                getAbstract() {
                    userId = sessionStorage.getItem("userId");
                   iscp_port = sessionStorage.getItem("iscp_port") || "";
                    let data = {
                        id: this.VoiceItem.id,
                        userId: userId,
                        timestamp: new Date().getTime() + ""
                    }
                    let AuthenticationSession = sessionStorage.getItem("Authentication");
                    data = JSON.stringify(data)
                    let sign = sm3(data);
                    $.ajax({
                        url: localUrlLink + iscp_port + '/tjAiAssistant/digest/textDigest2',
                        type: "post",
                        async: false, //是否同步，false表示同步请求
                        dataType: "json",
                        data,
                        headers: {
                            "Content-Type": "application/json;charset=UTF-8",
                            Authentication: AuthenticationSession,
                            sign: sign
                        },
                        success: (res, txt, xhr) => {
                            if (res.code == 200) {
                                if (res.resultValue?.digest_state_title == 0) {
                                    this.showDialog = false
                                    this.queryAbstract()
                                }
                            } else {
                                mui.toast(res.resultValue, {
                                    duration: '1000',
                                    type: 'div'
                                })
                            }
                        },
                        error: (e) => {
                            mui.toast('请求异常,请稍后再试', {
                                duration: '1000',
                                type: 'div'
                            })
                        },
                    });
                    // this.showDialog = true
                },
                saveAbstract() {
                   iscp_port = sessionStorage.getItem("iscp_port") || "";
                    let data = {
                        id: this.VoiceItem.id,
                        text: this.abstractContent,
                        timestamp: new Date().getTime() + ""
                    }
                    let AuthenticationSession = sessionStorage.getItem("Authentication");
                    data = JSON.stringify(data)
                    let sign = sm3(data);
                    $.ajax({
                        url: localUrlLink + iscp_port + '/tjAiAssistant/digest/redactDigest2',
                        type: "post",
                        async: false, //是否同步，false表示同步请求
                        dataType: "json",
                        data,
                        headers: {
                            "Content-Type": "application/json;charset=UTF-8",
                            Authentication: AuthenticationSession,
                            sign: sign
                        },
                        success: (response) => {
                            this.saveLoading = false
                            if (response.code == 200) {
                                mui.toast('保存成功', {
                                    duration: 'long',
                                    type: 'div'
                                })
                                this.readonly = true
                            } else {
                                mui.toast('保存失败', {
                                    duration: 'long',
                                    type: 'div'
                                })
                            }
                        },
                        error: (e) => {
                            mui.toast('请求异常,请稍后再试', {
                                duration: '1000',
                                type: 'div'
                            })
                            this.saveLoading = false
                        },
                    })
                },
                updateSpeaker() {
                    if (this.updateSpeakerName !== this.updateSpeakerItem.speakerName) {
                        if (this.radioType == '1') {
                            this.audio_speaker_content.forEach(
                                speaker => {
                                    if (speaker.speakerId == this.updateSpeakerItem.speakerId) {
                                        speaker.speakerName = this.updateSpeakerName ? this.updateSpeakerName : "发言人"
                                    }
                                }
                            );
                            this.updateSpeakerName = "";
                            this.radioType = '0';
                        } else {
                            let speakerName = this.updateSpeakerItem.speakerName;
                            this.audio_speaker_content.forEach(
                                speaker => {
                                    if (speaker.speakerId == this.updateSpeakerItem.speakerId) {
                                        speaker.speakerName = this.updateSpeakerName ? this.updateSpeakerName : "发言人"
                                    }
                                }
                            );
                            this.updateSpeakerName = "";
                            this.radioType = '0';
                        }
                        this.complete();
                    }
                    this.dialogVisible = false;
                },
                load() {
                    this.$refs.audio.load()
                },
                play() {
                    this.$refs.audio.play()
                },
                pause() {
                    this.$refs.audio.pause()
                },
                mousedownFunc() {
                    this.isDraging = true
                },
                mouseupFunc() {
                    this.isDraging = false
                },
                formatTooltip(val) {
                    const currTime = Math.floor((val / 100) * this.totalTimes)
                    const tempMin = Math.floor(currTime / 60)
                    const tempSec = currTime % 60
                    // console.log(toStringFunc(tempMin),tempMin,toStringFunc(tempSec),tempSec,111)
                    return `${toStringFunc(tempMin)} : ${toStringFunc(tempSec)}`
                },
                formatTooltipVol(vol) {
                    return Math.round(((vol * 2) / 100) * 10) / 10
                },
                clickFunc(val) {
                    if (val === 'play') {
                        this.isPlaying = !this.isPlaying
                        this.$refs.audio.play()
                    } else if (val === 'pause') {
                        this.isPlaying = !this.isPlaying
                        this.$refs.audio.pause()
                    } else if (val === 'speed') {
                        console.log(this.playSpeed);
                        this.$refs.audio.playbackRate = this.playSpeed
                    } else if (val === 'forward') {
                        // 减慢音频播放速度，速率范围[0.5，2]
                        if (this.playSpeed < 2) {
                            this.playSpeed += 0.5
                            this.$refs.audio.playbackRate = this.playSpeed
                        }
                    } else if (val === 'refresh') {
                        this.$refs.audio.playbackRate = 1
                        this.playSpeed = 1
                        this.$refs.audio.load()
                        this.$refs.audio.play()
                    }
                },
                setProcessFunc(val) {
                    this.$refs.audio.currentTime = Math.round((val / 100) * this.totalTimes)
                    this.$refs.audio.play()
                    // 重置拖动 setTimeout等滚动条滚到相应位置后再改变isHandleProcess状态
                    setTimeout(() => {
                        this.handleProcessClick.isHandleProcess = false
                    }, 2000)
                },
                // 把页面定位到相应语音文本的节点
                scrollIntoView(time) {
                    this.changearr.forEach((item) => {
                        if (Number(item.startTime) / 1000 <= time && time <= Number(item.endTime) / 1000) {
                            document.getElementById(item.serialNum).scrollIntoView({
                                behavior: 'smooth',
                                block: 'center'
                            });
                        }
                    })
                },
                // back-top 恢复页面到语音位置
                recoverProcess() {
                    //控制页面滚动条
                    this.changearr.forEach((item) => {
                        //如果第一句话的节点比第一次拖动的语音时间要大  就把页面滚动到顶部
                        if (this.changearr[0].startTime / 1000 > this.$refs.audio.currentTime) {
                            document.getElementById(this.changearr[0].serialNum).scrollIntoView({
                                behavior: 'smooth',
                                block: 'center'
                            });
                            return
                        }
                        // 把页面定位到相应语音文本的节点
                        this.scrollIntoView(this.$refs.audio.currentTime)
                    })
                    // 重置拖动 setTimeout等滚动条滚到相应位置后再改变isHandleProcess状态
                    // setTimeout(()=>{
                    //   this.handleProcessClick.isHandleProcess = false
                    // },500)
                },
                setVolumeFunc(vol) {
                    // 设置播放音量，audio音量范围[0,1]
                    this.$refs.audio.volume = Math.round((vol / 100) * 10) / 10
                },
                playPause() {
                    if (!this.isPlaying) {
                        clearInterval(this.cursorTimer);
                        this.$refs.audio.pause();
                    } else {
                        this.cursorTimer = setInterval(this.updateCursor, 100);
                        this.$refs.audio.play();
                    }
                },
                updateCursor() {
                    var audioDuration = this.$refs.audio.duration; // 获取音频总时长
                    var currentTime = this.$refs.audio.currentTime; // 获取当前播放时间
                    this.changearr.forEach((item) => {
                        if (Number(item.startTime) / 1000 <= currentTime && currentTime <= Number(item.endTime) / 1000) {
                            // console.log(document.getElementById(item.serialNum))
                            document.getElementById(item.serialNum).style.background = 'rgb(175, 226, 252)';
                            //当前音频距离顶部的距离
                            this.handleProcessClick.scrollTop = document.getElementById(item.serialNum).offsetTop
                            console.log('this.handleProcessClick.scrollTop', this.handleProcessClick.scrollTop)

                            //判断是否为拖动滚动条
                            console.log('updateCursor----', this.handleProcessClick.isHandleProcess)
                            if (!this.handleProcessClick.isHandleProcess) {
                                document.getElementById(item.serialNum).scrollIntoView({
                                    behavior: 'smooth',
                                    block: 'center'
                                });
                            }
                        } else {
                            document.getElementById(item.serialNum).style.background = 'none';
                        }
                    })
                    // const width = window.innerWidth; // 获取视窗宽度
                    // const percentage = (currentTime / audioDuration) * 100; // 计算当前时间占视频总时长的百分比
                    // const x = width * (percentage / 100); // 计算光标的x坐标
                    // cursor.style.left = `${x}px`; // 设置光标的left值
                },

                // 开始
                playFunc() {
                    this.playPause();
                    this.isPlaying = true
                    this.$emit('play', this.isPlaying)
                },
                // 暂时
                pauseFunc(e) {
                    // console.log('music is paused')
                    this.isPlaying = false
                    this.$emit('pause', this.isPlaying)
                    clearInterval(this.cursorTimer);
                },
                waitingFunc(e) {
                    this.isLoading = true;
                },
                timeupdateFunc(e) {
                    if (!this.isDraging) {
                        this.playProcess = (e.target.currentTime / this.totalTimes) * 100
                        this.currentTime = e.target.currentTime
                    }
                    this.$emit('timeupdate', this.currentTime, this.playProcess)
                    this.isLoading = false;
                },
                async canplayFunc(e) {
                    const firsthandAudio = e.target;
                    while (firsthandAudio.duration === Infinity) {
                        await new Promise(r => setTimeout(r, 200));
                        firsthandAudio.currentTime = 10000000 * Math.random();
                    }
                    this.totalTimes = firsthandAudio.duration;
                    this.isError = false
                    this.$refs.audio.volume = 0.5
                },
                errorFunc(e) {
                    this.isError = true
                },
                skipTime(seconds) {
                    const audio = this.$refs.audio;
                    var time = audio.currentTime + seconds;
                    this.$refs.audio.currentTime = time
                },

                // 判断安卓还是ios
                compatibleInput() {
                    //获取浏览器的userAgent,并转化为小写
                    var ua = navigator.userAgent.toLowerCase();
                    //判断是否是苹果手机，是则是true
                    var isIos = ua.indexOf("iphone") != -1 || ua.indexOf("ipad") != -1;
                    if (isIos) {
                        this.isflageIOX = true
                    } else {
                        this.isflageIOX = false
                    }
                },
                del() {
                    this.showPop = false;
                },
                confirm() {
                    if (!this.inputText || this.inputText.split(" ").join("").length == 0) {
                        mui.toast('标题不能为空', {
                            duration: 'long',
                            type: 'div'
                        })
                        return
                    }
                    this.titleText = this.inputText
                    sessionStorage.setItem("fileNameYU", this.titleText)
                    this.showPop = false;
                    this.complete();
                },
                header_title() {
                    this.inputText = this.filteredFileName
                    this.showPop = true
                },

                onOutPutFocus(ev) {
                    // this.voiceTxt.ind = this.inputDom.selectionStart
                    this.voiceTxt.ind = null
                },
                home() {
                    $(location).attr("href", "voiceRecordingList.html");
                    // if (this.titleText === this.oldTextitle) {
                    //     $(location).attr("href", "voiceRecordingList.html");
                    // } else {
                    //     var btnArray = ["取消", "确定"];
                    //     var i = 0
                    //     mui.confirm(
                    //         "请问是否进行保存？",
                    //         "消息提醒",
                    //         btnArray,
                    //         (e) => {
                    //             if (i > 0) return
                    //             i++
                    //             if (e.index == 1) {
                    //                 // this.complete()
                    //                 $(location).attr("href", "voiceRecordingList.html");
                    //             } else {
                    //                 $(location).attr("href", "voiceRecordingList.html");
                    //             }
                    //         }
                    //     );
                    // }
                },
                dateTimeText(value) {
                    if (!value || new Date(value) == 'Invalid Date') return "";
                    const date = new Date(value)
                    const currentY = new Date().getFullYear()
                    const Y = date.getFullYear()
                    const M = date.getMonth() + 1
                    const D = date.getDate()
                    const h = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
                    const m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
                    if (currentY === Y) {
                        return `${Y}年${M}月${D}日 ${h}:${m}`
                    } else {
                        return `${Y}年${M}月${D}日 ${h}:${m}`
                    }
                },
                subStance(id) {
                    this.titleText = ''
                    this.oldTextitle = ''
                    userId = sessionStorage.getItem("userId");
                   iscp_port = sessionStorage.getItem("iscp_port") || "";
                    const timestamp = new Date().getTime() + ""
                    let data = {
                        "id": id,
                        "section": 1, // 0不分 1 分段
                        "userId": userId,
                        "timestamp": timestamp,
                    };
                    let AuthenticationSession = sessionStorage.getItem("Authentication");
                    data = JSON.stringify(data)
                    let sign = sm3(data);
                    $.ajax({
                        url: localUrlLink + iscp_port + "/tjAiAssistant/voice/selectByIdVoiceNotes",
                        type: "post",
                        async: false, //是否同步，false表示同步请求
                        dataType: "json",
                        data: data,
                        headers: {
                            "Content-Type": "application/json;charset=UTF-8",
                            Authentication: AuthenticationSession,
                            sign: sign
                        },
                        success: (res, txt, xhr) => {
                            this.initLoading = false
                            if (sm3(res.resultValueStr) == xhr.getResponseHeader("sign")) {
                                let Authentication = xhr.getResponseHeader("Authentication")
                                if (res.code == 200) {
                                    if (Authentication) {
                                        sessionStorage.setItem("Authentication", Authentication);
                                        this.titleText = res.resultValue.messageTitle
                                        sessionStorage.setItem("fileNameYU", this.titleText)
                                        this.oldTextitle = res.resultValue.messageTitle
                                        this.timeText = this.dateTimeText(res.resultValue.createTime)
                                        let voiceSign = sm3(timestamp + "&" + res.resultValue.id);
                                     this.audioSrc = localUrlLink + iscp_port + `/tjAiAssistant/voice/getAudioById?Authentication=${Authentication}&id=${res.resultValue.id}&sign=${voiceSign}&timestamp=${timestamp}`
                                        console.log(this.audioSrc, " this.audioSrc ")
                                        this.audio_speaker_content = JSON.parse(res.resultValue.sectionMessage)
                                        console.log(this.audio_speaker_content);
                                        this.audio_speaker_content.forEach((item) => {
                                            if (!this.nameColor[item.speakerName]) {
                                                this.nameColor[item.speakerName] = this.colorList[Object.keys(this.nameColor).length];
                                            }
                                            if (item.content) {
                                                item.content.forEach((i) => {
                                                    if (i.subIndex == -1) {
                                                        i.word = i.word + "\n"
                                                    }
                                                    this.changearr.push(i)
                                                })
                                            }
                                        })
                                        console.log(this.changearr)
                                    }
                                } else {
                                    mui.toast(res.resultValue, {
                                        duration: 'long',
                                        type: 'div'
                                    })
                                }
                            } else {
                                mui.toast('完整性校验失败', {
                                    duration: 'long',
                                    type: 'div'
                                })
                            }
                        },
                        error: (e) => {
                            this.initLoading = false
                            mui.toast('请稍后再试', {
                                duration: 1000,
                                type: 'div'
                            })
                        },
                    });
                },
                // 修改接口
                getreviseVoice(id, messageTitle, timestamp) {
                    userId = sessionStorage.getItem("userId");
                   iscp_port = sessionStorage.getItem("iscp_port") || "";
                    let data = {
                        "id": id, //主键id
                        "messageTitle": messageTitle, //笔记标题
                        "sectionMessage": JSON.stringify(this.audio_speaker_content), //笔记内容
                        "userId": userId,
                        "sceneNo": 33,
                        "timestamp": timestamp,
                    };
                    let AuthenticationSession = sessionStorage.getItem("Authentication");
                    data = JSON.stringify(data)
                    let sign = sm3(data);
                    $.ajax({
                        url: localUrlLink + iscp_port + "/tjAiAssistant/voice/updateVoiceNotes",
                        type: "post",
                        async: false, //是否同步，false表示同步请求
                        dataType: "json",
                        data: data,
                        headers: {
                            "Content-Type": "application/json;charset=UTF-8",
                            Authentication: AuthenticationSession,
                            sign: sign
                        },
                        success: (res, txt, xhr) => {
                            $(".curtain").css("display", "none");
                            if (sm3(res.resultValueStr) == xhr.getResponseHeader("sign")) {
                                let Authentication = xhr.getResponseHeader("Authentication")
                                if (res.code == 200) {
                                    if (Authentication) {
                                        sessionStorage.setItem("Authentication", Authentication);
                                        // mui.toast('已保存', {
                                        //     duration: 1000,
                                        //     type: 'div'
                                        // })
                                        // setTimeout(() => {
                                        //     $(location).attr("href", "voiceRecordingList.html");
                                        // }, 1000)
                                    }
                                } else {
                                    mui.toast(res.resultValue, {
                                        duration: 'long',
                                        type: 'div'
                                    })
                                }
                            } else {
                                mui.toast('完整性校验失败', {
                                    duration: 'long',
                                    type: 'div'
                                })
                            }
                        },
                        error: (e) => {
                            $(".curtain").css("display", "none");
                            mui.toast('请稍后再试', {
                                duration: 1000,
                                type: 'div'
                            })
                        },
                    });
                },

                complete() {
                    if (!this.titleText && this.titleText.split(" ").join("").length == 0) {
                        mui.toast('标题不能为空', {
                            duration: 1000,
                            type: 'div'
                        })
                        return
                    } else {
                        $(".curtain").css("display", "block")
                        // if (this.VoiceFlag == false) { //修改
                        let data = {
                            "id": this.VoiceItem.id, //主键id
                            "messageTitle": this.titleText, //笔记标题
                            "timestamp": new Date().getTime() + ""
                        };
                        this.getreviseVoice(data.id, data.messageTitle, data.timestamp)
                    }
                },
                site(num,id) {
                    var datas = JSON.parse(JSON.stringify(this.audio_speaker_content))
                    var content = ''
                    if (this.titleText == '' || this.titleText.split(" ").join("").length == 0) {
                        mui.toast('标题不能为空', {
                            duration: 1000,
                            type: 'div'
                        })
                        return
                    } else {
                        datas.forEach((item, index) => {
                            if (index == 0) {
                                item.speakerName += "\n"
                            } else {
                                item.speakerName = "\n" + item.speakerName + "\n"
                            }
                            item.content.forEach((i) => {
                                if (i.subIndex == -1) {
                                    i.word = "\n" + i.word
                                }
                                item.speakerName += i.word
                            })
                            content += item.speakerName
                        })
                    }
                    if (num == 0) {
                        this.content = content
                        this.copy(0, 'tag-read')
                    } else {
                        this.mailbox(content,id)
                    }
                },
                copy(type, className) {
                    // if (this.checkSwitch == true) {
                    //   mui.toast('请关闭麦克风再保存！', {
                    //     duration: 1000,
                    //     type: 'div'
                    //   })
                    //   return
                    // }
                    let content = (type == 1 ? this.abstractContent : this.content)
                    if (content == '' || content.split(" ").join("").length == 0) {
                        mui.toast('内容不能为空', {
                            duration: 'long',
                            type: 'div'
                        })
                        return
                    }
                    if (!this.titleText || this.titleText.split(" ").join("").length == 0) {
                        mui.toast('标题不能为空', {
                            duration: 'long',
                            type: 'div'
                        })
                        return
                    }
                    let text1 = content;
                    var clipboard = new Clipboard('.' + className, {
                        // 通过target指定要复印的节点
                        text: function () {
                            return text1
                        }
                    });
                    console.log(5)
                    clipboard.on('success', (e) => {
                        mui.toast('复制成功', {
                            duration: 'long',
                            type: 'div'
                        })
                        addOperator(3, 1, "复制文本", 1, 1, "复制成功");
                    });
                    clipboard.on('error', (e) => {
                        mui.toast('复制失败', {
                            duration: 'long',
                            type: 'div'
                        })
                        addOperator(3, 1, "复制文本", 1, 0, "复制失败");
                    });
                },
                absMailbox() {
                    const text = this.abstractContent;
                    this.mailbox(text, 37)
                },
                // 发送邮箱
                mailbox(content, num) {
                    let toMail = sessionStorage.getItem("toMail")
                    if (!toMail && num == 0) {
                        mui.toast('请前往“我的”页面设置内网邮箱', {
                            duration: 1000,
                            type: 'div'
                        })
                        return
                    } else {
                        if (!this.titleText || this.titleText.split(" ").join("").length == 0) {
                            mui.toast('标题不能为空', {
                                duration: 1000,
                                type: 'div'
                            })
                        } else {
                             let text = num == 3 ? "是否同步至内网网站？" : "是否发送邮箱？"
                            var btnArray = ["取消", "确定"];
                            var i = 0;
                            mui.confirm(text,
                                "消息提醒",
                                btnArray,
                                (e) => {
                                    if (i > 0) return;
                                    i++;
                                    if (e.index == 1) {
                                        $(".curtain").css("display", "block");
                                        // $(".loader").css("display", "block");
                                        let data = {
                                            // "id": this.VoiceItem.id, //主键id
                                            "messageTitle": "AI助手-录音转写",
                                            //笔记标题
                                            "message": content,
                                            "saveType": num,
                                            //笔记内容
                                            "sceneNo": 33,
                                            // "sceneNo": num ? 37 : 33,
                                            "timestamp": new Date().getTime() + ""
                                        };
                                        this.sendMail(data.messageTitle, data.message, data.sceneNo,data.saveType, data.timestamp)
                                    } else {
                                        // $(location).attr("href", "Voice.html");
                                    }
                                }
                            );

                        }
                    }
                },
                sendMail(messageTitle, message, sceneNo, saveType,timestamp) {
                    const userId = sessionStorage.getItem("userId");
                    const orgId = sessionStorage.getItem("unitId")
                   iscp_port = sessionStorage.getItem("iscp_port") || "";
                    let data = {
                        "sceneNo": sceneNo, //31:实时转写  33导入音频
                        "messageTitle": messageTitle, //笔记标题
                        "message": message, //笔记标题+内容
                        "saveType": saveType, 
                        "fileName":this.titleText,
                        "orgId": orgId, //单位id
                        "userId": userId, //用户id
                        "timestamp": timestamp,
                    };
                    let AuthenticationSession = sessionStorage.getItem("Authentication");
                    data = JSON.stringify(data)
                    let sign = sm3(data);
                    $.ajax({
                        url: localUrlLink + iscp_port + "/tjAiAssistant/IdentificationFile/voiceSendMail",
                        type: "post",
                        // async: false, //是否同步，false表示同步请求
                        dataType: "json",
                        data: data,
                        headers: {
                            "Content-Type": "application/json;charset=UTF-8",
                            Authentication: AuthenticationSession,
                            sign: sign
                        },
                        success: (res, txt, xhr) => {
                            $(".curtain").css("display", "none");
                            if (sm3(res.resultValueStr) == xhr.getResponseHeader("sign")) {
                                let Authentication = xhr.getResponseHeader("Authentication")
                                if (res.code == 200) {
                                    if (Authentication) {
                                        sessionStorage.setItem("Authentication", Authentication);
                                        if(saveType == 3){
                                            showConfirmDialog("同步完成，请及时到内网网站aioa.sgcc.com.cn下载使用"," ")
                                        } else {
                                            mui.toast("已发送邮箱", {
                                            duration: 1000,
                                            type: 'div'
                                        })
                                        addOperator(3, 3, "发送邮箱", 1, 1, "发送邮箱成功");
                                        }
                                        
                                    }
                                } else if (res.code == 500) {
                                    if(saveType == 3){
                                    	syncToast('同步失败', 1500, "error", true)
                                    } else {
                                        mui.toast(res.resultValue, {
                                        duration: 'long',
                                        type: 'div'
                                    })
                                    addOperator(3, 3, "发送邮箱", 1, 0, "发送邮箱失败");
                                    }
                                  
                                }
                            } else {
                                mui.toast('完整性校验失败', {
                                    duration: 'long',
                                    type: 'div'
                                })
                                addOperator(3, 3, "发送邮箱", 1, 0, "发送邮箱失败");
                            }
                        },
                        error: (e) => {
                            $(".curtain").css("display", "none");
                            mui.toast('请稍后再试', {
                                duration: 1000,
                                type: 'div'
                            })
                            addOperator(3, 3, "发送邮箱", 1, 0, "发送邮箱失败");
                        },

                    });
                },
            }
        })
    </script>
</body>

</html>

<body>